import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.print.*;
import java.io.*;
import javax.swing.tree.*;
import javax.swing.border.*;

public class SimpleTable extends JInternalFrame implements InterInterface,InternalFrameListener{
    public int x = 0;
    
  
   Container c = getContentPane();
  
    String columnNames[] =  {"Roll No :","Marks Obtained"};
    String data[][] = new String[100][100];
      public  JTable table = new JTable(data,columnNames);
   
    public SimpleTable() {
        super("Lab Exam Result View",false,true,false,false);
       this.setBounds(110,50,400,200);
		setVisible(true);
		String st_roll_sub[] = dir.list();
		//st_num = new String[dir.list().length];
		for(int i = 0;i < dir.list().length; i++)
		{
			st_roll[i] = st_roll_sub[i];
		}
		
		
	}
	public SimpleTable(String roll,String num) {
		
				
	}
		
	public void SimpleTableView() {
		
	x = dir.list().length;
	//String st_nums[100] = st_num;
	
       for(int i = 0,j = 0; i < x; i++) {
			
		data[i][j] = st_roll[i];
	}
	for(int i = 0,j = 1; i < x; i++) {
		data[i][j] = st_num[i];	
		//System.out.println(st_num[i]);
	}
	
      	
        table.setPreferredScrollableViewportSize(new Dimension(500, 70));

       
       

        //Create the scroll pane and add the table to it. 
        JScrollPane crollPane = new JScrollPane(table);

        //Add the scroll pane to this window.
        c.add(crollPane, BorderLayout.CENTER);

      try
		{
			UIManager.setLookAndFeel(looks[1].getClassName());
			SwingUtilities.updateComponentTreeUI(this);
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
        
    }
public void SimpleTableSave() {
	this.setVisible(false);
	for(int i = 0;i < dir.list().length; i++)
		{
			if(st_roll[i].equals(roll_no.getText()))
			st_num[i] = ""+marks.getText();
			System.out.println(st_num[i]);
		}
		
}
	
	


   public void internalFrameClosing(InternalFrameEvent e) {
    	

        
    }

    public void internalFrameClosed(InternalFrameEvent e) {
    	
       
      
           
      }

    public void internalFrameOpened(InternalFrameEvent e) {
    
            
    }

    public void internalFrameIconified(InternalFrameEvent e) {
    	
        
    }

    public void internalFrameDeiconified(InternalFrameEvent e) {
    	
        
    }

    public void internalFrameActivated(InternalFrameEvent e) {
    	
         
    }

    public void internalFrameDeactivated(InternalFrameEvent e) {
         
    }	  

  
}
